home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 February / Macworld (1999-02).dmg / Shareware World / Shareware Feature / NetPresenz 4.1 / Documentation / Documentation Part 2 < prev    next >
Encoding:
Text File  |  1997-01-20  |  15.3 KB  |  174 lines  |  [TEXT/ttxt]

  1. NetPresenz v4.1 © 1992-97 Peter N Lewis
  2.  
  3. This program is $10 shareware.
  4.  
  5. NetPresenz was previously called “FTPd”.  This is the same program, albeit a new version.  If you have a license to FTPd, that license is automatically a license to use NetPresenz (although there is an upgrade fee if you purchased FTPd prior to Jan 1, 1996).
  6.  
  7. Documentation Part 2
  8.  
  9. Contents
  10.  
  11. Part 1
  12. What NetPresenz Does 
  13.     Features 
  14. Using NetPresenz Setup
  15.    FTP Setup 
  16.    WWW and Gopher Setup 
  17.    FTP Setup Details 
  18.    Scripting NetPresenz Setup 
  19. Using NetPresenz
  20.    Referring to your Server 
  21.       Using NetPresenz from a Un*x FTP Client 
  22.    Remote Volume Mounting 
  23.    Miscellaneous FTP Commands 
  24. WWW
  25.    Server Side Includes 
  26.    CGIs 
  27.    Java 
  28.    Missing files 
  29.    Gopher 
  30. Registering
  31.    Site Licensing
  32.  
  33. Part 2 
  34. Security Considerations
  35.    Avoid the Wrath of your Network Admin 
  36. Limitations
  37. Remote Site Access Restrictions 
  38. Warranty 
  39.    Fine Print 
  40. Acknowledgements
  41.    How It Works
  42.  
  43. Security Considerations
  44.  
  45. “Be afraid.  Be very afraid” - The Fly
  46.  
  47. Allowing NetPresenz to run on your Mac poses huge security questions.  Some of the same security questions are also posed by System 7 File Sharing.  However with NetPresenz they are much worse because you’re making your Mac accessible to everyone on a world wide network.  Things you definitely should do:
  48.  
  49. Disable guest logins unless you actually need them.  You need guest logins enabled for anonymous FTP, and Gopher or WWW access.
  50.  
  51. If you want a few people to have access, perhaps a better idea than guest login is to give them a single account with a shared password.  This is more secure than guest logins, since no matter how many people they tell the password to, it will always be less than the number of people who could log in as guests.
  52.  
  53. Disable remote mounting to guests or users.  Again, most people don’t need access to volumes other than those directly on your Macintosh (That is the Entire Volume and Shared Folder volumes).  You Definitely Should Not allow access to other volumes on the network if you do not control them, and you Definitely Should inform the administrators of any other servers on the network that you will be allowing access to them so that they can secure their servers as well.
  54.  
  55. Only share a small portion of your file system.  That way you don’t have to worry about the rest of it.  You, as the owner, can still get access to it by using the Users & Groups control panel to turn on the “Allow user to see entire disk” checkbox for your user.
  56.  
  57. Verify that the file sharing privileges are set correctly.  A good start is to change everything to owned by you and only visible/modifiable by you.  Then change the privileges on areas that you want to give users and guests access.
  58.  
  59. Keep your password secure!  Anyone on the Internet with your username, machine address and password will likely be able to delete every file on your harddisk.  This is a scary thought.  You should be scared.  Don’t give your password out and don’t use an obvious password.  Obvious passwords include, but are not limited to, any of the following patterns (in decreasing obviousness)...
  60. your user name.
  61. your real name.
  62. your initials.
  63. your husband’s/wife’s/girlfriend’s/boyfriend’s/dog’s/frog’s/machine’s etc name.
  64. your car licence plate, make, model, etc.
  65. your birthday.
  66. your student/MediCare/social security/tax file/etc number.
  67. any of the above backwards.
  68. any word from a dictionary (especially an electronic dictionary).
  69. Good passwords can be found by making up nonsense words or using
  70. letters from a common saying and by including non-alphanumeric ASCII
  71. characters.
  72.  
  73. Invalid login attempts are logged to a log file in the Preferences folder (assuming logging is enabled).  Check the log file regularly to improve your security.
  74.  
  75. If in doubt, don’t run NetPresenz.  I can’t accept any liability for any problems.  I have done my best to make sure it is secure.  If that is not good enough, don’t use it.  It’s as simple as that.
  76.  
  77.  
  78. Avoid the Wrath of your Network Admin
  79.  
  80. FTP can use a lot of bandwidth and so you should check with the system administrators on your network before setting up an FTP site for anything more than personal use.  
  81.  
  82. Also, since NetPresenz can make other servers on the entire AppleTalk Internet available for FTP, you should ensure that the administrators of such machines (including anyone who has File Sharing enabled on their Mac) are aware of this before you allow remote mounting.
  83.  
  84. I can’t accept any responsibility if you use this software in an irresponsible manner (in fact I won’t accept any responsibility no matter how you use this software!).  As long as you disable remote mounting and don’t try to become the next Info-Mac archive, it shouldn’t be much of a problem, but check with your network administrators anyway.
  85.  
  86.  
  87. Limitations
  88.  
  89. NetPresenz & NetPresenz Setup require System 7 with File Sharing turned on, MacTCP 1.1 or OpenTransport 1.1 (or later versions) and probably require the 128k ROM (or later).  NetPresenz should work fine with MacTCP 2.0.6 or Open Transport.
  90.  
  91. AutoDoubler users should exclude the folders that are shared with File Sharing.  Also, AutoDoubler causes uploads from the local machine to fail with an I/O Error - uploads from other machines seem to work ok, and it’s useless to upload from the same machine anyway, so this should not be a problem.
  92.  
  93. NetPresenz requires File Sharing or AppleShare which in turn requires AppleTalk.  If you are on a serial network (eg SLIP or PPP), then you may not have an AppleTalk network and you may not want to waste a serial port just to turn AppleTalk on.  You can get around this by using a Dummy network device which will let you have File Sharing on without any physical network connection.
  94.  
  95. If you use MacTCP you can use Dummy Adev:
  96. <ftp://ftp.stairways.com//stairways/thirdparty/dummy adev.sit.bin>
  97. or (especially if you have a Duo), try Single Talk:
  98. </info-mac/comm/atlk/single-talk-11.hqx>
  99.  
  100. If you use Open Transport you can use the Remote Only extension which comes in the Open Transport Extras directory of the Open Transport 1.1.1  installation.
  101.  
  102.  
  103. Remote Site Access Restrictions
  104.  
  105. You can limit the machines that can access your site by restricting access to certain IP ranges.  Because this would be very messy to do in a sensible user interface, the only way to set these restrictions is by using ResEdit.  From ResEdit, create a STR# resource (in either the NetPresenz Preferences file or NetPresenz (the former overrides the latter), give it an id in the range of 600-699, and a name ending of:
  106.  
  107. “<username> Site Restriction” where <username> is the user you are restricting.
  108. “Owner Site Restriction” to restrict the owner.
  109. “User Site Restriction” to restrict any unspecified user.
  110. “Anonymous Site Restriction” to restrict anonymous logins.
  111. “Default Site Restriction” to restrict anyone not specified above.
  112.  
  113. NetPresenz checks them in that order (for gopher restrictions, it checks Anonymous Site Restriction or Default Site Restriction).  Each resource consists of a sequence of pairs, IP number, IP mask, both in dotted decimal format (eg 134.7.70.70).  The remote IP is checked against the IP, with only the bits in the mask being relevant.  If it matches then the user is allowed access.  If it matches, but the IP string started with an exclamation mark then access is disallowed.  The last match overrides previous ones, and if there are no matches then access is denied.
  114.  
  115. By default, NetPresenz has a single “Default Site Restriction” STR# resource, which contains 0.0.0.0, 0.0.0.0 so access is allowed from anywhere.
  116.  
  117. Here are some examples, first if you just wanted to restrict anonymous logins to inside 134.7, and everyone else has no restriction, then you create two STR# resources, either in NetPresenz Preferences (which is checked first) or NetPresenz, like this:
  118.  
  119. “Anonymous Site Restriction”: 134.7.0.0,255.255.0.0
  120.  
  121. You don't need to create the “Default Site Restriction”, because it already exists in NetPresenz, if you wish to override the default, either change it in NetPresenz or add a “Default Site Restriction” to NetPresenz Preferences.
  122.  
  123. Ok, and a more complicated one, say you wanted anonymous access to everywhere inside 134.7 except 134.7.70.70, user access to everywhere inside 134.7 and 130.95, user "Fred" and the owner access from everywhere, do this:
  124.  
  125. “Anonymous Site Restriction”: 134.7.0.0,255.255.0.0, !134.7.70.70,255.255.255.255
  126. “User Site Restriction”: 134.7.0.0,255.255.0.0, 130.95.0.0,255.255.0.0
  127. “Owner Site Restriction”: 0.0.0.0,0.0.0.0
  128. “Fred Site Restriction”: 0.0.0.0,0.0.0.0
  129.  
  130. Note: These restrictions apply only to the control connection, not the data transfer connections, so it is still possible to use proxy-ftp to transfer files directly to a restricted machine, but the user must be connected from an allowed site.
  131.  
  132.  
  133. Warranty
  134.  
  135. This program should do what I’ve described in this document.  If it doesn’t, you can simply stop using it.  If you pay me, and within a year find that it doesn’t do what I describe here, then you can notify me and I will refund your money and cancel your license.
  136.  
  137.  
  138. Fine Print
  139.  
  140. Peter Lewis and Stairways Software Pty Ltd hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose.  Peter Lewis and Stairways Software Pty Ltd will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter Lewis, Stairways Software Pty Ltd, or an agent of his has been advised of the possibility of such damages.  In no event shall Peter Lewis or Stairways Software Pty Ltd be liable for any damages, regardless of the form of the claim.  The person using the software bears all risk as to the quality and performance of the software.
  141.  
  142. US Government:
  143.         Government End Users:  If you are acquiring the Software and fonts
  144. on behalf of any unit or agency of the United States Government, the
  145. following provisions apply.  The Government agrees:
  146.         (i) if the Software and fonts are supplied to the Department of
  147. Defense (DoD), the Software and fonts are classified as "Commercial
  148. Computer Software" and the Government is acquiring only "restricted rights"
  149. in the Software, its documentation and fonts as that term is defined in
  150. Clause 252.227-7013(c)(1) of the DFARS; and
  151.         (ii) if the Software and fonts are supplied to any unit or agency
  152. of the United States Government other than DoD, the Government's rights in
  153. the Software, its documentation and fonts will be as defined in Clause
  154. 52.227-19(c)(2) of the FAR or, in the case of NASA, in Clause
  155. 18-52.227-86(d) of the NASA Supplement to the FAR.
  156.  
  157.  
  158. Acknowledgements
  159.  
  160. Thanks to RobT for suggesting the idea, to Quinn for demanding the use of System 7 U&G, and to Jager for figuring out how! Thanks to Quinn (again :) for the amazing icons and to Greg for colouring them in.  And special thanks again to Jager and Quinn for figuring out my async problems!  And, of course, thanks to Stuart for delaying the release of this program for ages by making LOTS of suggestions, finding LOTS of bugs, and by writing Bolo! Thanks also to the UCC, Todd, Steve, c.s.m.p, archie.au, ftp.apple.com, Farhad, Tom, Andr'e, Aron, Ben, David, Gregory, Guy, Igor, Jim, John, Ken, Leonard, Frederic, Pete, Peter, Richard (who won the award for the most mail messages (after Quinn)), Rob, Russell, Thede, Tom, Zep, and anyone who uses NetPresenz!  
  161.  
  162. I can’t describe how important the beta testers have been in making NetPresenz what it is, without them NetPresenz would not be a shadow of what it is now.  So special thanks go to all of you who made suggestions or pointed out problems.  I tried to list you all, but I gave up, there are just too many.  Some of you made so many suggestions I couldn't count them all.  Some of you analysed the network packets to find out what was happening and explained where I was going wrong.  Some decompiled my code and sent it back to me with corrections.  Some made suggestions that involved tiny changes with great benefits.  Some made outrageous demands which I refused to do, and others outrageous demands which I eventually did.  All of these would have been missing if I was working on my own.  Thanks.
  163.  
  164. Thanks also to Mike Marburger for the closing sound.
  165.  
  166.  
  167. How It Works
  168.  
  169. NetPresenz listens for TCP connections on port 21.  When a connection is achieved, it waits for commands to be sent to it.  Commands all have a simple form, there is a 3 or 4 character command (eg, RETR for retrieve file), and some parameters (eg, filename).  NetPresenz interprets these commands, carries out their actions, and replies with a one line message, the first three characters of which are a 3 digit reply that can be interpreted by the FTP client, then the rest is human readable information.  The reply codes are 1yz for preliminary success (action started), 2yz for complete success (action finished successfully), 3yz for intermediate success (requires another command before any action is taken), 4yz for temporary failure (try again later), and 5yz for permanent failure (give up and go home).  For more information on the formats of these commands see the various FTP related RFCs.  Some commands may reply with a multiline response, in which the first line begins with a three digit response code followed by a dash “-” followed by several lines of text and terminated by a line with the same response code and a space followed by some text.  This confuses some servers, you can disable this feature by starting your username or password with a dash “-”.
  170.  
  171. NetPresenz also listens to port 70 for gopher connections.  It then accepts a single line specifying either a folder, file, or index, and returns the info for it.  The gopher server logs in as an AppleShare guest user, so guest access must be enabled (it was either that, or NetPresenz would have to know a user password, which I wanted to avoid).  The root of the gopher tree is specified by the login directory for fake user “Gopher” (it defaults to /).  This root is enforced, so you can’t have aliases pointing to folders outside this area (well, you can, but it won't work very well).  Aliases to files outside the area work.  You can reduce this restriction with the “GopherRoot” user directory, but that will allow anyone knowledgeable in the gopher protocol to get at any file inside that root.
  172.  
  173. NetPresenz talks to the file system on the local Mac (and other servers) exclusively by using the same protocols as if it were accessing an AppleShare server (the single exception is the startup messages which are read via normal file system calls).  The user logs in by giving a user name and password.  This in turn is passed to the System 7 server (or AppleShare server) and an attempt is made to log in to the server.  If the log in fails, an attempt is made to log in as a guest user.  If either attempt succeeds, the volume is made available to the user.  If the user tries to log in as either the owner or a user, they must successfully (non-anonymously) log in to at least one local volume or the whole connection is disallowed.  Since all file system access is done through the AppleShare protocols, it should be virtually impossible to circumvent their protections.  You should set up your system in such a way that irrespective of the privileges in NetPresenz Setup (which are not guaranteed in any way!) the user cannot do too much damage.  Thus users and guests should only have write privileges to areas of your file system that you wish them to be able to trash.
  174.